cmake_minimum_required(VERSION 3.5)

SET(CMAKE_C_COMPILER "/usr/bin/gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/g++")
add_definitions(-std=c++17)

project(client)

set(MY_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libs)

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG")

# 设置编译结果输出路径
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}  -fPIC -fvisibility=default")

include_directories(../include)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libs)

add_executable(client client.cc ../src/packet_base.cc ../src/log.cc)

# thread
find_package(Threads)
target_link_libraries(client ${CMAKE_THREAD_LIBS_INIT})

#spdlog
include_directories(../3rd)
target_link_libraries(client spdlog)
